import { get, post } from '@/request/index'
import { Result } from '@/request/Result'
import type { Ref } from 'vue'

export interface StatisticsParams {
  start_time?: string
  end_time?: string
  username?: string
}

export interface StatisticsData {
  id: string
  username: string
  nick_name: string
  email: string
  app_count: number
  dataset_count: number
  document_count: number
  chat_count: number
  chat_record_count: number
  app_created_count: number
  app_updated_count: number
  dataset_created_count: number
  dataset_updated_count: number
  document_created_count: number
  document_updated_count: number
  chat_created_count: number
  chat_updated_count: number
  chat_record_created_count: number
  chat_record_updated_count: number
}

export default {
  getStatistics(params: StatisticsParams, loading?: Ref<boolean>) {
    return get('statistics', params, loading)
  },
  getStatisticsDetail(params: StatisticsParams, loading?: Ref<boolean>) {
    return get('statistics/detail', params, loading)
  }
} 